class Solution
{
public:
    bool makeStringsEqual(string s, string target)
    {
        bool sAllZero = true;
        bool targetAllZero = true;
        bool allEqual = true;
        int n = s.size();
        for (int i = 0; i < n; ++i)
        {
            if (s[i] == '1')
            {
                sAllZero = false;
            }
            if (target[i] == '1')
            {
                targetAllZero = false;
            }
            if (s[i] != target[i])
            {
                allEqual = false;
            }
        }
        if (allEqual)
        {
            return true;
        }
        if (targetAllZero)
        {
            return false;
        }
        if (sAllZero)
        {
            return false;
        }
        return true;
    }
};